<?php
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'basic';
$return=array();
if($_RQ['op']=='basic'){
	$plugins =$this->plugins();
	$hdps =array(
		array('title'=>'首页','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp01.jpg','action'=>'/index/'),
		array('title'=>'全部','picurl'=>'../addons/jy_weishop/resource/images/mobile-hdp02.jpg','action'=>'/index/'),
	);
	$footernav = array(
			array('title'=>'商城首页','icon'=>'icon-shouye','color'=>'#cc99ff','action'=>'jy_weishop/index/'),
			array('title'=>'全部砍价','icon'=>'icon-store','color'=>'#66cc99','action'=>'jy_bargain/index/'),
			array('title'=>'我的砍价','icon'=>'icon-home','color'=>'#ff9933','action'=>'jy_bargain/act/'),
			array('title'=>'已购买','icon'=>'icon-yuding','color'=>'#66cc66','action'=>'jy_bargain/isbuy/'),
	);
	$item=$this->plugin_setting('basic');
	$item['hdps'] = !empty($item['hdps']) ? $item['hdps'] : $hdps;
	$item['footernav'] = !empty($item['footernav']) ? $item['footernav'] : $footernav;
	$return['item']=$item;
	$htmls=array(
		'type'=>'edit',
		'post'=>'post',
		'desc'=>'基本设置',
		'tabs'=>array(
		),
		'edit'=>array(
			array('name'=>'logo','title'=>'平台LOGO','type'=>'image'),
			array('name'=>'needfollow','title'=>'是否需要关注才能砍价？','type'=>'switch'),
			array('name'=>'followqrcode','title'=>'关注二维码','type'=>'image'),
			array('name'=>'title','title'=>'分享标题','type'=>'string'),
			array('name'=>'desc','title'=>'分享描述','type'=>'string'),
			array('name'=>'image','title'=>'分享图片','type'=>'image'),
			array('type'=>'array','name'=>'hdps','title'=>'幻灯片','add_tip'=>'添加一个幻灯片',
								'list'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片'),	
									array('type'=>'string','name'=>'url','title'=>'地址'),
								),
								'details'=>array(
									array('type'=>'image','name'=>'picurl','title'=>'图片','help'=>'推荐尺寸：自适应'),
									array('type'=>'link','name'=>'url','from'=>'action','title'=>'地址'),
								)
			),
			array('type'=>'array','name'=>'footernav','title'=>'底部导航','add_tip'=>'添加一个底部导航',
									'list'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'string','name'=>'action','title'=>'导航链接'),
									),
									'details'=>array(
										array('type'=>'string','name'=>'title','title'=>'导航名称'),
										array('type'=>'icon','name'=>'icon','from'=>'jinyunicon','title'=>'导航图标'),
										array('type'=>'link','name'=>'action','from'=>'action','title'=>'导航链接'),
									)
			),
			array('name'=>'rule','title'=>'规则设置','type'=>'richtext'),
			
			)
	);
	$return['htmls']=$htmls;
	exi($return);
}
if($_RQ['op']=='post'){
		$postdata=get_postdata();
		$this->plugin_setting('basic',$postdata);
		exi('设置成功');
	}